package com.whq.mvc.base.designpattern.composite;

public class MainTest {

    public static void main(String[] args) {
        OrganizationComponent university = new University("宜春学院","普通大学");
        OrganizationComponent college1 = new College("数计学院","计算机系");
        OrganizationComponent college2 = new College("经管学院","市场营销");
        OrganizationComponent departMent1 = new Department("计算机科学专业","11级");
        OrganizationComponent departMent2 = new Department("网络工程","11级");

        OrganizationComponent departMent3 = new Department("市场营销学","11级");
        OrganizationComponent departMent4 = new Department("会计学","11级");

        college1.add(departMent1);
        college1.add(departMent2);
        college2.add(departMent3);
        college2.add(departMent4);

        university.add(college1);
        university.add(college2);

        university.print();
    }
}
